#ifndef __PCF8563_H
#define __PCF8563_H

#include <stdint.h>
#include <time.h>

#define PCF8563_DEBUG 0

/* PCF8563 8位IIC地址 */
#define PCF8563_IIC_ADDR 0x51<<1

typedef struct _pcf8563_reg{
  uint8_t Control_status_1;
  uint8_t Control_status_2; 
  uint8_t VL_seconds;
  uint8_t Minutes;
  uint8_t Hours;
  uint8_t Days;
  uint8_t Weekdays;
  uint8_t Century_mounths;
  uint8_t Years;
}pcf8563_reg_type;

int pcf8563_set_time(struct tm *time_struct);
int pcf8563_get_time(struct tm *time_struct);

#if PCF8563_DEBUG
int pcf8563_get_reg(pcf8563_reg_type *pdata);
int pcf8563_set_reg(pcf8563_reg_type *pdata);
#endif
#endif
